package yf.mall.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;


/**
 *
 * 
 * @date Sun May 24 14:16:14 CST 2020
 */
@Getter
public enum AccountRecordBusEnum {


    TRANSFER(0, "调配"),

    CHARGE(1, "充值"),

    BACK(2, "返还"),

    REWARD(4, "利润"),

    PAY(5, "支付");

//    AUTO_PAY(6, "自动支付"),


//    AREA_REWARD(7, "区域奖励"),


//    SHOP(8, "店铺利润"),

//    PAYMENT(-2, "货款"),


//    SHARE_REWARD(3, "分享奖励"),

//    SHOP_MANAGER_REWARD(9, "店铺管理利润"),

//    LEVEL_PROFIT(10, "平级利润");

    int index;
    String value;

    AccountRecordBusEnum(int index, String value) {
        this.index = index;
        this.value = value;
    }

    public static Map toMap(){
      return   Arrays.stream(AccountRecordBusEnum.values()).collect(Collectors.toMap(AccountRecordBusEnum::getIndex,AccountRecordBusEnum::getValue));
    }

    public static String indexOf(int idx) {
        return AccountRecordBusEnum.values()[idx].getValue();
    }

}
